home *** CD-ROM | disk | FTP | other *** search
XSetup plugin | 2001-09-01 | 2.1 KB | 80 lines |
- "FILE"="Xteq Systems X-Setup Plugin 6.0"
- "TYPE"="4"
- "COUNT"="1"
- "UIPATH 1"="System\File System\Folders\Temporary"
- "NAME"="Windows 95/98 TEMP folder"
- "OSVERSION"="10100"
- "VERSION"="1.04"
- "LANGUAGE"="VBScript"
- "TEXT 1"="TEMP folder"
- "DESCRIPTION 1"="Some programs need an temporary location to store files that are "in progress" (normally C:\TEMP)."
- "DESCRIPTION 2"="Use this plug-in to select this location."
- "AUTHOR"="Xteq Systems"
- "CONTACTURL"="http://www.xteq.com"
- "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
- "COMMENT 1"="Thanks to AXCEL216 for this tip."
-
-
- 'Declaration of some constants
- sF="C:\AUTOEXEC.BAT"
- sV1="SET TEMP="
- sV2="SET TMP="
-
- 'Called when the Plugin is started
- Sub Plugin_Initialize
- Call FileSetAttribute(sF,"R-")
- Call FileSetAttribute(sF,"H-")
-
- TxtOpen(sF)
-
- i=TxtFindLine(sV1,false) 'search for first (TEMP), ignoring case
- if i>0 then
- s=TxtGetLine(i)
- 'strip out the part after the "="
- i=InStr(s,"=") 'find where "=" appears
- s=Right(s,len(s)-i) 'extract the part after the "="
-
- s1=s
- end if
-
- i=TxtFindLine(sV2,false) 'search for second (TMP), ignoring case
- if i>0 then
- s=TxtGetLine(i)
- 'strip out the part after the "="
- i=InStr(s,"=") 'find where "=" appears
- s=Right(s,len(s)-i) 'extract the part after the "="
-
- s2=s
- end if
-
- if len(s1)=0 then
- Call SetUIElement(1,s2)
- else
- Call SetUIElement(1,s1)
- end if
- End Sub
-
- 'Called when the Plugin should validate the Data the user has entered
- Sub Plugin_CheckData(ElementIndex)
- End Sub
-
- 'Called when the Plugin should apply the changes
- Sub Plugin_Apply(ElementIndex,ElementSubIndex)
- s=GetUIElement(1)
-
- i=TxtFindLine(sV1,false) 'search for second prompt, ignoring case
- Call TxtSetLine(i,sV1 & s) 'write to file
-
- i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
- Call TxtSetLine(i,sV2 & s) 'write to file
-
- Call FileBackup(sF) 'backup file
- Call TxtSave() 'save file
- End Sub
-
- 'Called when the Plugin is about to be removed from memory
- Sub Plugin_Terminate
- 'Call FileSetAttribute(sF,"H+")
- End Sub
-
-